import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

/*
 * isCard 判断是卡片 非必须
 * isTitle 标题的骨架屏，默认 非必须
 * cardWidth 卡片宽度
 * cardHeight 卡片高度
 */
class CoinRankingListItemSkeleton extends StatelessWidget {
  final bool isTitle;
  final num cardWidth;
  final num cardHeight;

  const CoinRankingListItemSkeleton(
      {Key key,
        this.isTitle = true,
        this.cardWidth,
        this.cardHeight})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    ScreenUtil.init(context, designSize: Size(375, 667), allowFontScaling: false);
    return Container(
      margin: EdgeInsets.fromLTRB(10, 5, 10, 5),
      height: 80.0,
      child: isTitle == true
          ? Row(
        children: [
          Expanded(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Container(height: 10.0, color: Colors.grey),
                Container(width:70.0,alignment:Alignment.centerLeft,height: 10.0, color: Colors.grey,margin: EdgeInsets.only(top: 20),),
              ],
            ),
          ),
          Column(
            children: [
              Container(width:70.0,height: 10.0, color: Colors.grey,margin: EdgeInsets.only(left: 20),),
            ],
          )
        ],
      )
          : Container(
        width: ScreenUtil().setWidth(cardWidth),
        height: ScreenUtil().setWidth(cardHeight),
        decoration: BoxDecoration(
            borderRadius: BorderRadius.all(Radius.circular(25)),
            color: Colors.grey),
      ),
    );
  }
}
